<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <tr>
        <td>编号</td>
        <td>书名</td>
        <td>价格</td>
        <td>类目</td>
        <td>库存</td>
        <td>图片</td>
        <td>说明</td>
        <td>作者</td>
        <td>已售</td>
        <td>操作</td>
    </tr>

    <!--onsubmit="return submitForm()提交之前校验-->
    <form th:action="@{/findBooks}" method="get" >

        <tr th:each="book:${book}">
            <td th:text="${book.id}"></td>
            <td th:text="${book.name}"></td>
            <td th:text="${book.price}"></td>
            <td th:text="${book.category}"></td>
            <td th:text="${book.pnum}"></td>
            <td>
                <img th:src="${book.imgurl}" width="100px" alt="img">
            </td>
            <td th:text="${book.description}"></td>
            <td th:text="${book.author}"></td>
            <td th:text="${book.sales}"></td>
            <td>
                <a th:href="@{/findBookById(id=${book.getId()})}">修改</a>
                <a th:href="@{/deleteBook(id=${book.getId()})}">删除</a>
            </td>
        </tr>
    </form>
</table>

</body>
</html>